﻿; (function ($) {
    var methods = {///添加弹出窗口明细
        close: function () {
            var layerPlane = $(this).parents(".layermbox[index]");
            if (layerPlane.length > 0) {
                parent.layer.close($(layerPlane[0]).attr("Index"));
            } else {
                console.log("未找到元素的窗体！");
            }
        },
        get: function () {
            var layerPlane = $(this).parents(".layermbox[index]");
            if (layerPlane.length > 0) {
                return $(layerPlane[0]);
            } else {
                console.log("未找到元素的窗体！");
                return null;
            }
        }
    }
    $.fn.Form = function (method) {
        if (methods[method]) {
            return methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
        } else if (typeof method === 'object' || !method) {
            return methods.init.apply(this, arguments);
        } else {
            $.error('Method' + method + 'does not exist');
        }
    };
})($);